<template>
	<view>
		<view class="phone-input">
			<u--input placeholder="请您输入姓名" border="none" v-model="numberphone" clearable></u--input>
		</view>
		<view class="comfir-btn">
			<view class="qd-btn" @click="$dianji(updateNumberPhone,'onoff')">
				确定
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				onoff: true,
				tips: '',
				numberphone: '', //手机号码
				currentPhone: ''
			}
		},
		onLoad(options) {
			this.currentPhone = options.currentphone;
		},
		methods: {
			//提交
			updateNumberPhone() {
				if (!this.numberphone) {
					uni.showToast({
						icon: 'none',
						title: '姓名不能为空！'
					})
					return
				}
				uni.$u.http.post(`/base/mobile/userInfo/updatePortraitOrSex`, {
					realName: this.numberphone
				}).then(res => {
					if (res.code == 0) {
						uni.$u.toast('修改成功！')
						uni.reLaunch({
							url: '/pages/subPackagesD/mycenter/userinfo'
						})
					}
				}).catch(err => {})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #ffffff;
	}

	.phone-title {
		font-size: 28rpx;
		color: #000000;
		padding: 20rpx 30rpx;
		background: #fff;
	}

	.phone-input {
		height: 112rpx;
		margin-top: 30rpx;
		background: #fff;
		display: flex;
		align-items: center;
		padding: 0 20rpx;

	}

	.comfir-btn {
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		margin-top: 60rpx;

		.qd-btn {
			width: 90%;
			border-radius: 12rpx;
			background: #0F53AC;
			color: #fff;
			font-size: 34rpx;
			text-align: center;
			padding: 20rpx 0;
		}
	}
</style>